//
//  TFDownloadFileOperation.h
//  离线断点下载_NSURLSeesion
//
//  Created by Guo Rui on 2017/9/7.
//  Copyright © 2017年 GR Harry. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef NS_ENUM(NSUInteger, TFDownloadOperationStatus) {
    // 下载还未开始
    TFDownloadOperationNone   = 100,
    // 开始下载
    TFDownloadOperationStart,
    // 成功下载完成
    TFDownloadOperationFinish,
    // 任务取消
    TFDownloadOperationCancel,
    // 任务暂停
    TFDownloadOperationPause,
    // 任务失败
    TFDownloadOperationFail,
};

@interface TFDownloadFileOperation : NSOperation
{
    BOOL        executing;  // 执行中
    BOOL        finished;   // 已完成
}

//@property (assign, nonatomic) TFDownloadOperationStatus stauts;

- (instancetype)initWithDownloadUrl:(NSString *)url;

/**
 *  @brief 暂停
 */
- (void)pause;

/**
 *  @brief 恢复
 */
- (void)resume;
@end
